<?php

namespace App\Http\Cache;

use Illuminate\Support\Facades\Cache;

class AuthCache
{
    protected static int $expire = 60 * 60 * 2;

    public static function setUser($token, $user): void
    {
        Cache::put('user-' . $token, $user, self::$expire);
    }

    public static function getUser($token): array
    {
        return Cache::get('user-' . $token) ?: [];
    }
}
